<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<!doctype html>
<html lang="en">
	<head>
		<meta charset="UTF-8">
		<title><?php echo ($webData["title"]); ?></title>
		<link rel="shortcut icon" href=" __PUBLIC__/Imgs/bitbug_favicon.ico" />
		<link href="__PUBLIC__/Home/Css/header.css" rel="stylesheet" type="text/css" />	
	</head>
	<body>
		<div id="header_top">
<!--			<img src="__ROOT__/Uploads/thumb/th_<?php echo ($webData["logo"]); ?>" style="float:left;" width="150">-->
			<img src="__ROOT__/Uploads/thumb/st.jpg" style="float:left;" width="150">
			<form action="__APP__/Index/searchFoods" method="post">
				<input type="text" id="header_seach" name="fname">
				<input type="submit" id="header_sub" value="搜索">
			</form>

			<ul id="header_ul">
				<li><a href="__APP__/Index/index/">首页</a></li>
				<li><a href="__APP__/Bclass/index/">菜谱分类</a></li>
			</ul>
			<div id="header_login">
			<?php if(empty($_SESSION['uname'])): ?><span>
						<a href="__APP__/Login/login/" target="_blank">
							登录
						</a>
					</span>
					<span>
						<a href="__APP__/Login/reg/" target="_blank">
							注册
						</a>
					</span>
			<?php else: ?>				
				<span>
					<a href="">
					<?php echo (session('uname')); ?>
					</a>
				</span>
				<span>
					<a href="__APP__/Ucenter/index/pass">
					个人中心
					</a>
				</span>
				<span>
					<a href="__APP__/Carts/showCarts/">
					购物车
					</a>
				</span>
				<?php if(!empty($_SESSION['uMsg'])): ?><span>
					<a href="__APP__/Posts/details/form_number/<?php echo (session('uMsg')); ?>" class="clearMsg">
					新订单
					</a>
				</span><?php endif; ?>
				<span style="font-size:14px;">
					<a href="__APP__/Public/loginout/">
					退出
					</a>
				</span><?php endif; ?>
			</div>
		</div>
		<div style="clear:both;height:30px;"></div>
	</body>
</html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
	<script type="text/javascript" src="__PUBLIC__/Js/jquery-1.8.3.js"></script>
	<link href="__PUBLIC__/Home/Css/sclass_index.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript">

		$(function(){
			/*添加到购物车Ajax*/
			$('.addCarts').click(function(){

				var fid = $(this).attr('alt');
				var url = '__APP__/Carts/setCarts/';
				var nowobj = $(this);

				$.post(url,{id:fid},function(cdata){

					if('YES' == cdata.data){

						nowobj.text('已添加');
					}else if('NO' == cdata.data){
						nowobj.text('已存在');
					}else{
						if(!confirm('您还没有登录,去登录吗?')){
							return false;
						}
						window.location.href = "__APP__/Login/login";
					}
				});
			});

			/*最新美食信息Ajax*/
			// $('.getNewFoods').click(function(){

			// 	var url = '__APP__/Sclass/getFoods/';

			// 	$.post(url,{opr:'new'},function(cdata){
			// 		alert(1);
			// 		$('#left_right').next('.list_img').remove();

			//                                       	for(var s in cdata.data){
			// 		var html = '';
			// 		html += '<div class="list_img">';
			// 		html += '<a href="__APP__/Foods/details/id/'+cdata.data[s].id+'">';
			// 		html += '<img src="__ROOT__/Uploads/Foods/thumb/th_'+cdata.data[s].pic+'" width="180" height="120" style="float:left;">';
			// 		html += '</a>';
			// 		html += '<font style="margin-left:10px;color:#992222;font-size:18px;">'+cdata.data[s].name+'</font><br>';
			// 		html += '<font style="margin-left:10px;color:#AA8B6B;font-size:13px;">价格:'+cdata.data[s].price+'￥</font>';
			// 		html += '<font style="margin-left:10px;color:#909090;font-size:13px;">
			// 				<a alt="'+cdata.data[s].id+'" class="addCarts">
			// 					+购物车
			// 				</a>
			// 			</font>';
			// 		html += '<font style="margin-left:10px;float:left;color:#909090;font-size:12px;">
			// 				标签:'+cdata.data[s].sname+'
			// 			</font>';
			// 		html += '</div>';
			// 		$('#left_right').next().after(html);
			// 		}


			// 	});
			// });

		});

	</script>
</head>
<body>
<div id="index_main">
	<div id="left_left">
		<ul>
			<a href="__APP__/Bclass/index"><li>全部分类</li></a>
			<?php if(is_array($data)): $i = 0; $__LIST__ = $data;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$vo): $mod = ($i % 2 );++$i;?><a href="__APP__/Sclass/index/id/<?php echo ($vo["id"]); ?>"><li style="text-indent:1em;"><?php echo ($vo["sname"]); ?></li></a><?php endforeach; endif; else: echo "" ;endif; ?>
		</ul>

		<div style="clear:both;border-bottom:#EBE9E7 1px solid;height:30px;"></div>
	</div>
	<div id="left_right">
		<div>
			<font style="font-size:14px;">全部美食</font>
		</div>

		<?php if(is_array($fdata)): $i = 0; $__LIST__ = $fdata;if( count($__LIST__)==0 ) : echo "" ;else: foreach($__LIST__ as $key=>$fvo): $mod = ($i % 2 );++$i;?><div class="list_img">
				<a href="__APP__/Foods/details/id/<?php echo ($fvo["id"]); ?>">
					<img src="__ROOT__/public/Uploads/<?php echo ($fvo["pic"]); ?>" width="180" height="120" style="float:left;">
				</a>
				<font style="margin-left:10px;color:#992222;font-size:15px;">
					<?php echo ($fvo["name"]); ?>
				</font><br/>
				<font style="margin-left:10px;color:#AA8B6B;font-size:13px;">
					价格:<?php echo ($fvo["price"]); ?>￥
				</font><br>
				<font style="margin-left:10px;color:#909090;font-size:13px;">
					<a alt="<?php echo ($fvo["id"]); ?>" class="addCarts">
						+购物车
					</a>
				</font>
				<font style="margin-left:10px;float:left;color:#909090;font-size:12px;">
					标签:<?php echo (substr($fvo["sname"],0,30)); ?>
				</font>
			</div>

			<?php if($i%2 == 0): ?><div style="clear:both;"></div><?php endif; endforeach; endif; else: echo "" ;endif; ?>
		<!-- <div class="list_img">
            <img src="__PUBLIC__/Home/Imgs/100019256.1.jpg" alt="">
        </div> -->
	</div>

</div>
</body>
</html>